from typing import Optional
from datetime import datetime
from pydantic import BaseModel, Field

class HotelOrderPassengerBase(BaseModel):
    hotel_order_id: int
    Name: str = Field(..., description="乘客姓名")
    BirthdayDTS: datetime = Field(..., description="乘客生日")
    CertificateType: str = Field(..., description="乘客证件类型")
    CertificateNo: str = Field(..., description="乘客证件号码")

class HotelOrderPassengerCreate(HotelOrderPassengerBase):
    pass

class HotelOrderPassengerUpdate(BaseModel):
    Name: Optional[str] = None
    BirthdayDTS: Optional[datetime] = None
    CertificateType: Optional[str] = None
    CertificateNo: Optional[str] = None

class HotelOrderPassenger(HotelOrderPassengerBase):
    ID: int

    class Config:
        from_attributes = True 